import {http_get_file_list_url, http_upload_file_url} from '../utils';

/**
 * 不需要回填属性 model的组件
 */
export const noModelList = [
    'button',
    'divider',
    'card',
    'control',
    'grid',
    'table',
    'alert',
    'text',
    'html',
];


export const basicsList = [
    {
        type: 'input',
        label: '单行输入框',
        icon:'icon-input',
        options: {
            type: 'text',
            width: '100%',
            defaultValue: '',
            placeholder: '请输入',
            clearable: false,
            maxLength: null,
            prepend: '',
            append: '',
            tooptip: '',
            hidden: false,
            disabled: false,
        },
        model: '',
        key: '',
        rules: [

            {
                required: false,
                message: '必填项',
                trigger: 'blur',
            },
        ],
    },
    {
        type: 'textarea',
        label: '多行输入框',
        icon:'icon-editor',
        options: {
            width: '100%',
            maxLength: null,
            defaultValue: '',
            rows: 4,
            clearable: false,
            tooptip: '',
            hidden: false,
            disabled: false,
            placeholder: '请输入',
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
                trigger: 'blur',
            },
        ],
    },
    {
        type: 'number',
        label: '数字输入框',
        icon:'icon-number',
        options: {
            width: '100%',
            defaultValue: 0,
            min: 0,
            max: 100,
            precision: null,
            tooptip: '',
            prepend: '',
            append: '',
            step: 1,
            hidden: false,
            disabled: false,
            placeholder: '请输入',
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
                trigger: 'blur',
            },
        ],
    },
    {
        type: 'select',
        label: '选择器',
        icon:'icon-select',
        options: {
            width: '100%',
            defaultValue: '',
            multiple: false,
            disabled: false,
            clearable: false,
            hidden: false,
            placeholder: '请选择',
            valueKey: 'value',
            tooptip: '',
            dynamic: 0,
            remoteFunc: '',
            dataPath: '',
            remoteValue: '',
            remoteLabel: '',
            linkage: false,
            dictType: '',
            options: [
                {
                    value: '1',
                    label: '下拉框1',
                },
            ],
            showSearch: false,
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
                trigger: 'blur',
            },
        ],
    },
    {
        type: 'checkbox',
        label: '多选框',
        icon:'icon-checkbox',
        options: {
            disabled: false,
            hidden: false,
            defaultValue: [],
            dynamic: 0,
            tooptip: '',
            remoteFunc: '',
            dataPath: '',
            remoteValue: '',
            remoteLabel: '',
            linkage: false,
            dictType: '',
            options: [
                {
                    value: '1',
                    label: '选项1',
                },
                {
                    value: '2',
                    label: '选项2',
                },
            ],
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
                trigger: 'blur',
            },
        ],
    },
    {
        type: 'radio',
        label: '单选框',
        icon:'icon-radio',
        options: {
            disabled: false,
            hidden: false,
            defaultValue: '',
            dynamic: 0,
            tooptip: '',
            remoteFunc: '',
            dataPath: '',
            remoteValue: '',
            remoteLabel: '',
            linkage: false,
            dictType: '',
            options: [
                {
                    value: '1',
                    label: '选项1',
                },
                {
                    value: '2',
                    label: '选项2',
                },
            ],
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'date',
        label: '日期选择器',
        icon:'icon-date',
        options: {
            width: '100%',
            defaultValue: '',
            rangeDefaultValue: [],
            range: false,
            disabled: false,
            hidden: false,
            clearable: false,
            placeholder: '请选择',
            tooptip: '',
            rangeStartPlaceholder: '开始时间',
            rangeEndPlaceholder: '结束时间',
            format: 'yyyy-MM-dd',
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'time',
        label: '时间选择器',
        icon:'icon-time',
        options: {
            width: '100%',
            defaultValue: '',
            disabled: false,
            tooptip: '',
            hidden: false,
            clearable: false,
            placeholder: '请选择',
            format: 'HH:mm:ss',
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'datePicker',
        label: '日期时间选择器',
        icon:'icon-date',
        options: {
            width: '100%',
            defaultValue: '',
            rangeDefaultValue: [],
            range: false,
            disabled: false,
            hidden: false,
            clearable: false,
            placeholder: '请选择',
            tooptip: '',
            rangeStartPlaceholder: '开始时间',
            rangeEndPlaceholder: '结束时间',
            format: 'yyyy-MM-dd HH:mm:ss',
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'rate',
        label: '评分',
        icon:'icon-rate',
        options: {
            defaultValue: null,
            max: 5,
            tooptip: '',
            disabled: false,
            hidden: false,
            allowHalf: false,
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'alert',
        label: '警告提示',
        icon:'icon-alert',
        options: {
            tooptip: '',
            title: '',
            type: 'info',
            description: '',
            closable: true,
            center: true,
            showIcon: false,
            effect: 'light',
            closeText: '',
        },
        key: '',
    },
    {
        type: 'slider',
        label: '滑块',
        icon:'icon-alert',
        options: {
            width: '100%',
            defaultValue: 0,
            disabled: false,
            hidden: false,
            min: 0,
            tooptip: '',
            max: 100,
            step: 1,
            showInput: false,
            marks: [],
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'uploadFile',
        label: '上传文件',
        icon:'icon-input',
        options: {
            defaultValue: [],
            multiple: false,
            disabled: false,
            tooptip: '',
            hidden: false,
            width: '100%',
            limit: 3,
            limitSize: 10,
            accept: '',
            name: 'file',
            headers: [{'label': 'token', 'value': '64685b8ab1aa962eab779b62716ee84d'}],
            action: 'http://localhost:8990/ng-server/file/upload',
            responseFileUrl: 'data.url',
            placeholder: '上传',
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'uploadImg',
        label: '上传图片',
        icon:'icon-input',
        options: {
            defaultValue: [],
            multiple: false,
            hidden: false,
            disabled: false,
            width: '100%',
            tooptip: '',
            limit: 3,
            placeholder: '上传图片',
            limitSize: 10,
            name: 'file',
            headers: [],
            action: '',
            responseFileUrl: '',
            listType: 'picture-card',
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },

    {
        type: 'cascader',
        label: '级联选择器',
        icon:'icon-cascader',
        options: {
            disabled: false,
            hidden: false,
            defaultValue: undefined,
            showSearch: false,
            placeholder: '请选择',
            multiple: false,
            clearable: false,
            dynamic: 0,
            tooptip: '',
            remoteFunc: '',
            dataPath: '',
            remoteValue: '',
            remoteLabel: '',
            options: [
                {
                    value: '1',
                    label: '选项1',
                    children: [
                        {
                            value: '11',
                            label: '选项11',
                        },
                    ],
                },
                {
                    value: '2',
                    label: '选项2',
                    children: [
                        {
                            value: '22',
                            label: '选项22',
                        },
                    ],
                },
            ],
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },

    {
        type: 'switch',
        label: '开关',
        icon:'icon-switch',
        options: {
            defaultValue: false,
            activeText: '',
            inactiveText: '',
            tooptip: '',
            hidden: false,
            disabled: false,
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },
    {
        type: 'button',
        label: '按钮',
        icon:'icon-button',
        options: {
            type: 'primary',
            handle: 'submit',
            textAlign: 'left',
            dynamicFun: '',
            tooptip: '',
            hidden: false,
            disabled: false,
        },
        key: '',
    },
    {
        type: 'batch',
        label: '动态表格',
        icon:'icon-row',
        list: [],
        options: {
            scrollY: 0,
            disabled: false,
            hidden: false,
            showLabel: false,
            hideSequence: false,
            labelWidth: '100',
            addType: 'dialog',
            labelPosition: 'left',
            customStyle: '',
            customClass: '',
            showItem: [],
            colWidth: {},
            width: '100%',
        },
        model: '',
        key: '',
    },
    {
        type: 'text',
        label: '文字',
        icon:'icon-span',
        options: {
            textAlign: 'left',
            tooptip: '',
            hidden: false,
            showRequiredMark: false,
        },
        key: '',
    },
    {
        type: 'html',
        label: 'HTML',
        icon:'icon-input',
        options: {
            tooptip: '',
            hidden: false,
            defaultValue: '<strong>HTML</strong>',
        },
        key: '',
    },
];



export const personalList = [
    {
        type: 'state',
        label: '城市选择器',
        icon:'icon-input',
        options: {
            defaultValue: '',
            maxLevel: 3,
            showAllPath: true,
            separator: '-',
            oneByOne: true,
            tooptip: '',
            hidden: false,
            disabled: false,
        },
        model: '',
        key: '',
        rules: [
            {
                required: false,
                message: '必填项',
            },
        ],
    },

];


export const layoutList = [
    {
        type: 'divider',
        label: '分割线',
        icon:'icon-divider',
        options: {
            tooptip: '',
            orientation: 'left',
            direction: 'horizontal',
        },
        key: '',
        model: '',
    },
    {
        type: 'control',
        label: '弹性容器',
        icon:'icon-input',
        list: [],
        options: {
            width: '100%',
            bordered: true,
            disabled: false,

            customStyle: '',
            customClass: '',
            noCopy: false,
            noAdd: false,
            noRemove: false,
        },
        key: '',
        model: '',
    },
    {
        type: 'grid',
        label: '栅格布局',
        icon:'icon-grid',
        columns: [
            {
                span: 12,
                list: [],
            },
            {
                span: 12,
                list: [],
            },
        ],
        options: {
            gutter: 0,
        },
        key: '',
        model: '',
    },
    {
        type: 'table',
        label: '表格布局',
        icon:'icon-row',
        trs: [
            {
                tds: [
                    {
                        colspan: 1,
                        rowspan: 1,
                        list: [],
                    },
                    {
                        colspan: 1,
                        rowspan: 1,
                        list: [],
                    },
                ],
            },
            {
                tds: [
                    {
                        colspan: 1,
                        rowspan: 1,
                        list: [],
                    },
                    {
                        colspan: 1,
                        rowspan: 1,
                        list: [],
                    },
                ],
            },
        ],
        options: {
            width: '100%',
            bordered: true,
            bright: false,
            small: true,
            customStyle: '',
            customClass: '',
        },
        key: '',
        model: '',
    },
];
